﻿using System.Drawing;
using System.Windows.Forms;

namespace CodeLibrary.Controls.Images
{
    public partial class ImageListContainer : UserControl
    {
        public ImageListContainer()
        {
            InitializeComponent();
        }

        private static ImageListContainer _instance;

        public static ImageList Images
        {
            get
            {
                if(_instance == null)
                    _instance = new ImageListContainer();
                return _instance.imglist;
            }
        }

        public static ImageList GetSizedImages(byte pixel)
        {

            ImageList images = new ImageList();
            images.ImageSize = new Size(pixel, pixel); 
            images.ColorDepth = ColorDepth.Depth32Bit;
            for (int i = 0; i < Images.Images.Count; i++)
            {
                images.Images.Add(Images.Images[i]);    
            }
            return images;
        }
    }
}
